<?php
use Yii\helpers\Html;
$this->title = '用户信息设置';
?>
<div class="container">
    <div class="row">
      
        <?php echo $this->render('_leftnav') ?>
        <div class="col-md-10">
          <div class="page-header clearfix">
            <h1 class="pull-left">用户信息设置</h1>
            <div class="pull-right">

              <button type="button" class="btn btn-success btn-sm pull-right" data-toggle="modal" data-target="#myModal">添加字段</button>

            </div>
          </div>
        <?php echo $this->render('_usersetting') ?>
<form action="" class="form-horizontal" method="post">
  <fieldset>
    <legend>自定义字段设置</legend>
    <table class="table table-striped table-hover" id="course-table">
      <thead>
      <tr>
        <th>字段名称</th>
        <th>类型</th>
        <th>是否显示</th>
        <th>显示序号</th>
        <!-- <th>创建时间</th> -->
        <th>操作</th>
      </tr>
      </thead>
      <tbody>
          <tr><td colspan="20"><div class="empty">暂无自定义字段</div></td></tr>
      </tbody>
    </table>
  </fieldset>
  
  
  <fieldset>
    <legend>个人资料设置</legend>
    <div class="form-group">
      <div class="col-md-3 control-label">
        <label>购买课程或班级时填写个人资料</label>
      </div>
      <div class="controls col-md-8 radios">
        <label><input name="buy_fill_userinfo" value="1" type="radio"> 开启</label><label><input name="buy_fill_userinfo" value="0" checked="checked" type="radio"> 关闭</label>
        <p class="help-block">开启后，学员购买课程时，需填写个人资料</p>
      </div>

      <div class="controls col-md-8 col-md-offset-3" id="show-list">
        <div class="pull-left">
                  </div>
          
        <div class="pull-right ">
          <a href="javascript:" id="show-list-btn">编辑 
            <span class="glyphicon glyphicon-chevron-down"></span>
          </a>
        </div>
      </div>

      <div class="controls col-md-8 col-md-offset-2" id="show-register-list" style="display:none">
        <div class="form-group">
          <ul class="register-list sortable-list list-unstyled col-md-12" data-role="list">
            
                            
                                            <li class="list-group-item clearfix" data-role="item">
                  <span class="glyphicon glyphicon-resize-vertical sort-handle"></span>&nbsp;
                  <input name="userinfoFields[]" value="email" type="checkbox">
                  <input name="userinfoFieldNameArray[]" value="email" type="hidden"> 
                  邮箱地址
                  <span class="text-muted">  (带格式校检)</span>                </li>
                              <li class="list-group-item clearfix" data-role="item">
                  <span class="glyphicon glyphicon-resize-vertical sort-handle"></span>&nbsp;
                  <input name="userinfoFields[]" value="truename" type="checkbox">
                  <input name="userinfoFieldNameArray[]" value="truename" type="hidden"> 
                  姓名
                                  </li>
                              <li class="list-group-item clearfix" data-role="item">
                  <span class="glyphicon glyphicon-resize-vertical sort-handle"></span>&nbsp;
                  <input name="userinfoFields[]" value="mobile" type="checkbox">
                  <input name="userinfoFieldNameArray[]" value="mobile" type="hidden"> 
                  手机号码
                  <span class="text-muted">  (带格式校检)</span>                </li>
                              <li class="list-group-item clearfix" data-role="item">
                  <span class="glyphicon glyphicon-resize-vertical sort-handle"></span>&nbsp;
                  <input name="userinfoFields[]" value="qq" type="checkbox">
                  <input name="userinfoFieldNameArray[]" value="qq" type="hidden"> 
                  QQ
                                  </li>
                              <li class="list-group-item clearfix" data-role="item">
                  <span class="glyphicon glyphicon-resize-vertical sort-handle"></span>&nbsp;
                  <input name="userinfoFields[]" value="company" type="checkbox">
                  <input name="userinfoFieldNameArray[]" value="company" type="hidden"> 
                  公司
                                  </li>
                              <li class="list-group-item clearfix" data-role="item">
                  <span class="glyphicon glyphicon-resize-vertical sort-handle"></span>&nbsp;
                  <input name="userinfoFields[]" value="idcard" type="checkbox">
                  <input name="userinfoFieldNameArray[]" value="idcard" type="hidden"> 
                  身份证号码
                                  </li>
                              <li class="list-group-item clearfix" data-role="item">
                  <span class="glyphicon glyphicon-resize-vertical sort-handle"></span>&nbsp;
                  <input name="userinfoFields[]" value="gender" type="checkbox">
                  <input name="userinfoFieldNameArray[]" value="gender" type="hidden"> 
                  性别
                                  </li>
                              <li class="list-group-item clearfix" data-role="item">
                  <span class="glyphicon glyphicon-resize-vertical sort-handle"></span>&nbsp;
                  <input name="userinfoFields[]" value="job" type="checkbox">
                  <input name="userinfoFieldNameArray[]" value="job" type="hidden"> 
                  职业
                                  </li>
                              <li class="list-group-item clearfix" data-role="item">
                  <span class="glyphicon glyphicon-resize-vertical sort-handle"></span>&nbsp;
                  <input name="userinfoFields[]" value="weibo" type="checkbox">
                  <input name="userinfoFieldNameArray[]" value="weibo" type="hidden"> 
                  微博
                                  </li>
                              <li class="list-group-item clearfix" data-role="item">
                  <span class="glyphicon glyphicon-resize-vertical sort-handle"></span>&nbsp;
                  <input name="userinfoFields[]" value="weixin" type="checkbox">
                  <input name="userinfoFieldNameArray[]" value="weixin" type="hidden"> 
                  微信
                                  </li>
              
              
                      </ul>

          <div class="help-block col-md-12"><span class="text-success">可拖动调整次序。酌情勾选需要收集的字段，若需要新的字段，请在［自定义字段设置］中添加。</span></div>

        </div>
        <div class="mbl" style="text-align:center;">
          <a href="javascript:" id="hide-list-btn">收起 
            <span class="glyphicon glyphicon-chevron-up"></span>
          </a>
        </div>
      </div>
    </div>

    <div class="form-group">
      <div class="col-md-3 control-label">
        <label>登录后填写个人资料</label>
      </div>
      <div class="controls col-md-8 radios">
        <label><input name="fill_userinfo_after_login" value="1" type="radio"> 开启</label><label><input name="fill_userinfo_after_login" value="0" checked="checked" type="radio"> 关闭</label>
        <p class="help-block">开启后，学员登录后需填写个人资料</p>
      </div>

      <div class="controls col-md-8 col-md-offset-3" id="show-checked-fields-list">
        <div class="pull-left">
                                                                        <button type="button" class="btn btn-default btn-xs">
                邮箱地址
              </button>
                              </div>
          
        <div class="pull-right ">
          <a href="javascript:" id="show-fields-list-btn">编辑 
            <span class="glyphicon glyphicon-chevron-down"></span>
          </a>
        </div>
      </div>

      <div class="controls col-md-8 col-md-offset-2" id="show-fields-list" style="display:none">
        <div class="form-group">
          <ul class="fill-userinfo-list sortable-list list-unstyled col-md-12" data-role="list">
            
                                                                          <li class="list-group-item clearfix" data-role="item">
                  <span class="glyphicon glyphicon-resize-vertical sort-handle"></span>&nbsp;
                  <input name="registerSort[]" value="email" checked="checked" type="checkbox">
                  <input name="registerFieldNameArray[]" value="email" type="hidden"> 
                  邮箱地址                  <span class="text-muted">  (带格式校检)</span>                </li>
                                                              <li class="list-group-item clearfix" data-role="item">
                  <span class="glyphicon glyphicon-resize-vertical sort-handle"></span>&nbsp;
                  <input name="registerSort[]" value="truename" type="checkbox">
                  <input name="registerFieldNameArray[]" value="truename" type="hidden"> 
                  姓名                                  </li>
                                                              <li class="list-group-item clearfix" data-role="item">
                  <span class="glyphicon glyphicon-resize-vertical sort-handle"></span>&nbsp;
                  <input name="registerSort[]" value="mobile" type="checkbox">
                  <input name="registerFieldNameArray[]" value="mobile" type="hidden"> 
                  手机号码                  <span class="text-muted">  (带格式校检)</span>                </li>
                                                              <li class="list-group-item clearfix" data-role="item">
                  <span class="glyphicon glyphicon-resize-vertical sort-handle"></span>&nbsp;
                  <input name="registerSort[]" value="idcard" type="checkbox">
                  <input name="registerFieldNameArray[]" value="idcard" type="hidden"> 
                  身份证号码                                  </li>
                                                              <li class="list-group-item clearfix" data-role="item">
                  <span class="glyphicon glyphicon-resize-vertical sort-handle"></span>&nbsp;
                  <input name="registerSort[]" value="gender" type="checkbox">
                  <input name="registerFieldNameArray[]" value="gender" type="hidden"> 
                  性别                                  </li>
                                                              <li class="list-group-item clearfix" data-role="item">
                  <span class="glyphicon glyphicon-resize-vertical sort-handle"></span>&nbsp;
                  <input name="registerSort[]" value="job" type="checkbox">
                  <input name="registerFieldNameArray[]" value="job" type="hidden"> 
                  职业                                  </li>
                                                              <li class="list-group-item clearfix" data-role="item">
                  <span class="glyphicon glyphicon-resize-vertical sort-handle"></span>&nbsp;
                  <input name="registerSort[]" value="company" type="checkbox">
                  <input name="registerFieldNameArray[]" value="company" type="hidden"> 
                  公司                                  </li>
                                                              <li class="list-group-item clearfix" data-role="item">
                  <span class="glyphicon glyphicon-resize-vertical sort-handle"></span>&nbsp;
                  <input name="registerSort[]" value="qq" type="checkbox">
                  <input name="registerFieldNameArray[]" value="qq" type="hidden"> 
                  QQ                                  </li>
                                                              <li class="list-group-item clearfix" data-role="item">
                  <span class="glyphicon glyphicon-resize-vertical sort-handle"></span>&nbsp;
                  <input name="registerSort[]" value="weixin" type="checkbox">
                  <input name="registerFieldNameArray[]" value="weixin" type="hidden"> 
                  微信                                  </li>
                                                              <li class="list-group-item clearfix" data-role="item">
                  <span class="glyphicon glyphicon-resize-vertical sort-handle"></span>&nbsp;
                  <input name="registerSort[]" value="weibo" type="checkbox">
                  <input name="registerFieldNameArray[]" value="weibo" type="hidden"> 
                  微博                                  </li>
                                    </ul>

          <div class="help-block col-md-12"><span class="text-success">可拖动调整次序。酌情勾选需要收集的字段，若需要新的字段，请在［自定义字段设置］中添加。</span></div>

        </div>
        <div class="mbl" style="text-align:center;">
          <a href="javascript:" id="hide-fields-list-btn">收起 
            <span class="glyphicon glyphicon-chevron-up"></span>
          </a>
        </div>
      </div>
    </div>
  </fieldset>

  <fieldset>
    <legend>其它设置</legend>
    <div class="form-group">
      <div class="col-md-3 control-label">
        <label>头像设置提醒</label>
      </div>
      <div class="controls col-md-8 radios">
        <label><input name="avatar_alert" value="none" checked="checked" type="radio"> 从不</label><label><input name="avatar_alert" value="in_user_center" type="radio"> 每次进入"我的课程"时</label><label><input name="avatar_alert" value="when_join_course" type="radio"> 加入免费课程时强制要求</label>
      </div>
    </div>
    <div class="form-group">
      <div class="col-md-3 control-label">
        <label>用户修改用户名</label>
      </div>
      <div class="controls col-md-8 radios">
        <label><input name="nickname_enabled" value="1" checked="checked" type="radio"> 开启</label><label><input name="nickname_enabled" value="0" type="radio"> 关闭</label>
      </div>
    </div>
  </fieldset>

  <div class="form-group">
    <div class="col-md-3 control-label"></div>
    <div class="controls col-md-8">
      <button type="submit" class="btn btn-primary">提交</button>  
    </div>
  </div>
  <input name="_csrf_token" value="4253d99d13d8903560ffb063080795e920d63105" type="hidden">
  <input name="_cloud_sms" value="" type="hidden">
</form>

<div class="modal fade" id="myModal">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
        <h4 class="modal-title">添加字段</h4>
      </div>
      <form data-widget-cid="widget-0" novalidate="novalidate" method="post" class="form-horizontal" id="field-form" action="http://dcoffee.edusoho.com.cn/admin/user_fields/add">
      <div class="modal-body">
            
            <div class="form-group "> 
             <label class="col-md-4 control-label" for="field_title">字段名称</label>
              <div class="col-md-6 controls">
              <input data-explain="" data-widget-cid="widget-1" name="field_title" id="field_title" class="form-control" type="text">
              <div class="help-block" style="display:none;"></div></div>
            </div>

            <div class="form-group "> 
             <label class="col-md-4 control-label" for="field_type">字段类型</label>
              <div class="col-md-6 controls">
                  <select data-explain="" data-widget-cid="widget-3" class="form-control" name="field_type" id="field_type">
                    <option selected="selected" value="" num="">请选择</option>
                    <option value="varchar" num="还可以添加10个字段">文本</option>
                    <option value="text" num="还可以添加10个字段">多行文本</option>
                    <option value="int" num="还可以添加5个字段,最大值为9位整数">整数</option>
                    <option value="float" num="还可以添加5个字段,保留到两位小数">小数</option>
                    <option value="date" num="还可以添加5个字段">日期</option>
                  </select>
                  <div class="help-block" id="type_num" style="color:green;"></div>
              </div>
            </div> 

            <div class="form-group "> 
             <label class="col-md-4 control-label" for="field_seq">显示序号</label>
              <div class="col-md-6 controls">
              <input data-explain="" data-widget-cid="widget-2" name="field_seq" id="field_seq" class="form-control" value="1" type="text">
              <div class="help-block" style="display:none;"></div></div>
            </div>

            <div class="form-group "> 
             <label class="col-md-4 control-label">是否启用、显示</label>
             <div class="col-md-2"><input checked="checked" name="field_enabled" vaule="1" style="height:18px;width:18px;" type="checkbox"></div>
            </div>
            <input name="_csrf_token" value="4253d99d13d8903560ffb063080795e920d63105" type="hidden">
       </div> 
      
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
        <button type="submit" class="btn btn-primary" id="add-btn">保存</button>
      </div>
      </form>
    </div>
  </div>
</div>
        </div>

          </div>
  </div>